#include <Windows.h>
#include <tchar.h>
#include <stdio.h>

const TCHAR* GetArchitecture(int nID)
{
	switch (nID)
	{
		case PROCESSOR_ARCHITECTURE_INTEL:			return _T("x86");
		case PROCESSOR_ARCHITECTURE_MIPS:			return _T("MIPS");
		case PROCESSOR_ARCHITECTURE_ALPHA:			return _T("Alpha");
		case PROCESSOR_ARCHITECTURE_PPC:			return _T("PPC");
		case PROCESSOR_ARCHITECTURE_SHX:			return _T("AHX");
		case PROCESSOR_ARCHITECTURE_ARM:			return _T("ARM");
		case PROCESSOR_ARCHITECTURE_IA64:			return _T("IA64");
		case PROCESSOR_ARCHITECTURE_ALPHA64:		return _T("Alpha64");
		case PROCESSOR_ARCHITECTURE_MSIL:			return _T("MSIL");
		case PROCESSOR_ARCHITECTURE_AMD64:			return _T("AMD64");
		case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:	return _T("IA32ONWIN64");
	}
	return _T("Unknow");
}

void main()
{
	SYSTEM_INFO sysInfo;
	GetSystemInfo(&sysInfo);

	_tprintf(_T("Process Info: \n"));
	_tprintf(_T("\tType: %d\n")
		     _T("\tCore Num: %d\n") 
		     _T("\tArchitecture: %s(%d)\n") 
		     _T("\tLevel: %d\n"),
			 sysInfo.dwProcessorType,
			 sysInfo.dwNumberOfProcessors, 
			 GetArchitecture(sysInfo.wProcessorArchitecture), 
			 sysInfo.wProcessorArchitecture,
			 sysInfo.wProcessorLevel, 
			sysInfo.wProcessorRevision);
	_tprintf(_T("Memory Info: \n"));
	_tprintf(_T("\tPage Size: %d\n")
			 _T("\tMin App Address: %d\n")
			 _T("\tMax App Address: %d\n"),
		     sysInfo.dwPageSize,
			 sysInfo.lpMaximumApplicationAddress,
			 sysInfo.lpMinimumApplicationAddress);
	
	system("pause");

	return; 
}